package com.xiaomimall.front.Address;

import com.xiaomi.front.dao.Address.AddressDao;
import com.xiaomi.pojo.Address;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class Addresstest {
    private ApplicationContext context ;

    @Before
    public void init() {

        context = new ClassPathXmlApplicationContext("spring-config-all.xml") ;
    }

    @Test
    public void RegUserTest(){
        List<Address>addressList=context.getBean(AddressDao.class).addList(1);
        System.out.println(addressList.toString());
    }
    @Test
    public void UpdateAdd(){
        Address address=new Address();
        address.setAname("小明");
        address.setPhonenum("13399880090");
        address.setAddress("河北省石家庄市长安区xxxx");
        address.setUid(1);
        address.setAid(1);
        int count=context.getBean(AddressDao.class).UpdateAddress(address);
        System.out.println(count);
    }
}
